<?php

namespace AdminBundle\Report;

/**
 * Created by PhpStorm.
 * User: George
 * Date: 2017/10/8
 * Time: 12:23
 */
class TaskFactory
{
    private static $taskMap = [
//        'WXNewContactTask' => 'NewContactTask',// 新增好友:匹配好友类型与标签
        'WXUploadFriendsInfoTask' => 'ContactUploadTask',// 成员好友:上报成员好友,粉丝信息
    ];

    public static function create($uri)
    {
        if (isset(self::$taskMap[$uri]) == false) {
//            throw new \InvalidArgumentException($uri . ' not exist.');
            return null;
        }

        $class = sprintf("%s\\%s", __NAMESPACE__, self::$taskMap[$uri]);
        return new $class();
    }
}